using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;

public class ecstest : MonoBehaviour
{
    public GameObject Target;
    public Vector3 speed;
    public Vector3 force;
    public Vector3 forword;
    void Start()
    {
        Target = GameObject.Find("Target");
        speed = Vector3.zero; 
        
    }

    // Update is called once per frame
    void Update()
    {
        forword = Target.transform.position-gameObject.transform.position;
        speed += forword.normalized * Time.deltaTime * 10;
        transform.position += speed * Time.deltaTime;
        if (speed != Vector3.zero)
            transform.forward = speed.normalized;
    }
}
